Preview - Constructing A Simple Model: Solid Diffusion

Choosing agents, environment and setup


This lesson is structured to go through the steps of designing an ABM. For each step, you will first try it on your own. Then, you'll get to see the way the authors of this lesson would do it. It doesn't mean your way is wrong if it is different than ours, because there are always multiple ways to model something, but it will be helpful to have something to compare against.

In accordance with the ABM design principle to start simple and build toward the question you want to answer, our model will be of a solid diffusion couple of two very similarly sized elements (in fact we will treat them as the same size for now) and we will model the atomic lattice in two dimensions using a square lattice.

The Fire Model you worked with is below as a reference, because some of the steps reference it as an example.

 


Questions

Please answer the questions below.

The first step is to choose the agents of the model. For example, in the Fire model, the agents are fires and trees. Turtles are used to represent fires and patches acted as sites on which a tree may or may not exist. What should the agents of the diffusion model be?


The next step is choosing agent properties. For example, in the Fire model, patches can be green or black to represent a tree or an empty spot in the forest. Turtles are either "fires" or "embers". They were represented as different "breeds" in the model. A breed is a specialized type of turtle to help distinguish between different types of agents in the model. "Fire" and "ember" breeds have different colors. They also have a location (as all turtles do), but it never changes. In the Fire model, all the agents only used default properties (e.g. color), but they were chosen to represent different things. It is possible to give agents additional properties, but in this case it wasn't necessary.

What should the properties of the agents in the diffusion model be? Remember to start simple.


Before continuing with the design of the model, we will implement what we have so far in a setup procedure. When you are first designing a model, it can be helpful to first write the model setup in "pseudo-code" which just means that you write it in a code-like way without worrying about getting the commands right. For example, the setup procedure for the Fire model in pseudo-code could be:

  • Ask patches to turn green with a probability equal to the "density" parameter
  • Ask patches on the left edge to ignite (which creates turtles of the "fire" breed).

Write a setup procedure in pseudo code for the diffusion model. Remember we are modeling a solid diffusion couple of two similar sized elements, with a two dimensional square lattice.


If you had any issues on this page, describe them below. If not, type something like "no problems" and continue on.


Notes

These notes will appear on every page in this lesson so feel free to put anything here you'd like to keep track of.